package com.bye.xiaomi_mall.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bye.xiaomi_mall.mapper.TdOrderDetailMapper;
import com.bye.xiaomi_mall.domain.TdOrderDetail;
import com.bye.xiaomi_mall.service.ITdOrderDetailService;

/**
 * 订单详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-16
 */
@Service
public class TdOrderDetailServiceImpl implements ITdOrderDetailService 
{
    @Autowired
    private TdOrderDetailMapper tdOrderDetailMapper;

    /**
     * 查询订单详情
     * 
     * @param id 订单详情主键
     * @return 订单详情
     */
    @Override
    public TdOrderDetail selectTdOrderDetailById(Long id)
    {
        return tdOrderDetailMapper.selectTdOrderDetailById(id);
    }

    /**
     * 查询订单详情列表
     * 
     * @param tdOrderDetail 订单详情
     * @return 订单详情
     */
    @Override
    public List<TdOrderDetail> selectTdOrderDetailList(TdOrderDetail tdOrderDetail)
    {
        return tdOrderDetailMapper.selectTdOrderDetailList(tdOrderDetail);
    }

    /**
     * 新增订单详情
     * 
     * @param tdOrderDetail 订单详情
     * @return 结果
     */
    @Override
    public int insertTdOrderDetail(TdOrderDetail tdOrderDetail)
    {
        return tdOrderDetailMapper.insertTdOrderDetail(tdOrderDetail);
    }

    /**
     * 修改订单详情
     * 
     * @param tdOrderDetail 订单详情
     * @return 结果
     */
    @Override
    public int updateTdOrderDetail(TdOrderDetail tdOrderDetail)
    {
        return tdOrderDetailMapper.updateTdOrderDetail(tdOrderDetail);
    }

    /**
     * 批量删除订单详情
     * 
     * @param ids 需要删除的订单详情主键
     * @return 结果
     */
    @Override
    public int deleteTdOrderDetailByIds(Long[] ids)
    {
        return tdOrderDetailMapper.deleteTdOrderDetailByIds(ids);
    }

    /**
     * 删除订单详情信息
     * 
     * @param id 订单详情主键
     * @return 结果
     */
    @Override
    public int deleteTdOrderDetailById(Long id)
    {
        return tdOrderDetailMapper.deleteTdOrderDetailById(id);
    }

    @Override
    public List<TdOrderDetail> selectOrderDetail(String orderCode) {
        return tdOrderDetailMapper.selectOrderDetail(orderCode);
    }

    @Override
    public List<TdOrderDetail> selectTdOrderDetailByCodeId(String codeId) {
        return tdOrderDetailMapper.selectOrderDetail(codeId);
    }
}
